import React from "react";
import { Link, HashRouter as Router, Route, Switch } from "react-router-dom";
import Home from "./Home";
import About from "./About";
import Comment from "./Comment";

export default class Main extends React.Component {
  render() {
    return (
      <Router>
        <div>
          <Link to="/">Home</Link>
          <br />
          <Link to="/about">About</Link>
          <br />
          <Link to="/comment">Comment</Link>
          <hr />
          <Switch>
            <Route exact={true} path="/">
              <Home />
            </Route>
            <Route path="/about">
              <About />
            </Route>
            <Route path="/comment">
              <Comment />
            </Route>
          </Switch>
        </div>
      </Router>
    );
  }
}
